import instance from "./require";
import type { hrlistTS } from "../store/crmsTS";

//获取岗位管理数据
export let http_getlist = (): Promise<Array<hrlistTS>> => {
    return instance.get('/hrlist')
}

//添加岗位数据
export let http_addlist = (obj: hrlistTS): Promise<hrlistTS> => {
    return instance.post('/hrlist', obj)
}

//编辑岗位数据
export let http_updatelist = (obj: hrlistTS): Promise<hrlistTS> => {
    return instance.patch(`/hrlist/${obj.id}`, obj)
}

//删除岗位数据
export let http_dellist = (id: number) => {
    return instance.delete(`/hrlist/${id}`)
}

//搜索岗位数据
export let http_searchlist = (params: hrlistTS):any => {
    return instance.get('/hrlist',
        { params: { 'name_like': params.name, 'collect_like': params.collect } }
    )
}